#include <stdio.h>
#include <stdlib.h>

typedef struct MyStruct St;
struct MyStruct {
	int id;
	St *p;
};

int *getRandomInts(int n, int max);
St *getTypedStruct();

int i=0;

void main() {

	int *array;
	printf("\nrandom generation program.");
	array = (int *)getRandomInts(10, 100);
	printf("\n10 numeri random fra 1 e 100");
	for(i=0; i<10;i++) printf(" %d", array[i]);
}

int *getRandomInts(int n, int max) {
	int *r = (int *)malloc(n*sizeof(int));

	for(i=0; i<n;i++) {
		r[i]=rand()%max+1;
	}

	return r;
}

St *getTypedStruct() {
	St *s = malloc(sizeof(St));
	s->id = 0;
	s->p = s;
	return s;
}
